package com.bdqn.bookshop.task;

import com.bdqn.bookshop.common.BookConstants;
import com.bdqn.bookshop.utils.FileUtil;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author : 罗若然[LUO_RUO_RAN]
 * @date : 2020-07-28 12:15
 **/
@Component
public class FileTask {

    /**
     * 每天0秒59分23点清理垃圾文件
     */
    @Scheduled(cron = "0 59 23 * * ? ")
    public void deleteFile(){
        FileUtil.deleteFiles(BookConstants.SETTING_SAVE_PATH);
        FileUtil.deleteFiles(BookConstants.GUIDE_SAVE_PATH);
    }

}
